﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SourceControlEssentials
{
    class Shevchenko : IStudent
    {
        public override int GetHashCode()
        {
            return 22;
        }

        public int Id()
        {
            return GetHashCode();
        }

        public string GetLastName()
        {
            return "Shevchenko";
        }

        public string GetFirstName()
        {
            return "Valeriya";
        }

        public int GetGroup()
        {
            return 318;
        }

        public string ExecuteStrategy(string value)
        {
            String result = "";
            String[] words = value.Split(' ');
            int[] count = new int[words.Length];
            for (int i = 0; i < words.Length; i++)
                for (int j = 0; j < words.Length; j++)
                    if (words[i].Equals(words[j]))
                        count[i]++;
            for (int i = 0; i < words.Length; i++)
                result += words[i] + "[" + count[i] + "] ";
            return result;
        }

        public string MethodName()
        {
            return "Word counts";
        }
    }
}
